const Common = require('../store/common')


module.exports = {
    registerLightTheme(echarts) {
        echarts.registerTheme(Common.default.THEME.LIGHT, {
            "color": [
                "#ff6060",
                "#5086ff",
                "#ffc600",
                "#42debf",
                "#ff71a6"
            ],
            "backgroundColor": "rgba(0,0,0,0)",
            "textStyle": {},
            "title": {
                "textStyle": {
                    "color": "#262626"
                },
                "subtextStyle": {
                    "color": "#262626"
                }
            },
            "line": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": "1"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": "2"
                    }
                },
                "symbolSize": "5",
                "symbol": "emptyCircle",
                "smooth": true
            },
            "radar": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": "1"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": "2"
                    }
                },
                "symbolSize": "5",
                "symbol": "emptyCircle",
                "smooth": true
            },
            "bar": {
                "itemStyle": {
                    "normal": {
                        "barBorderWidth": 0,
                        "barBorderColor": "#ccc"
                    },
                    "emphasis": {
                        "barBorderWidth": 0,
                        "barBorderColor": "#ccc"
                    }
                }
            },
            "pie": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "scatter": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "boxplot": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "parallel": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "sankey": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "funnel": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "gauge": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "candlestick": {
                "itemStyle": {
                    "normal": {
                        "color": "#c12e34",
                        "color0": "#2b821d",
                        "borderColor": "#c12e34",
                        "borderColor0": "#2b821d",
                        "borderWidth": 1
                    }
                }
            },
            "graph": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": 1,
                        "color": "#aaaaaa"
                    }
                },
                "symbolSize": "5",
                "symbol": "emptyCircle",
                "smooth": true,
                "color": [
                    "#ff6060",
                    "#ffc600",
                    "#5086ff",
                    "#42debf",
                    "#ff71a6"
                ],
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#7e7e7e"
                        }
                    }
                }
            },
            "map": {
                "itemStyle": {
                    "normal": {
                        "areaColor": "#dddddd",
                        "borderColor": "#eeeeee",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "areaColor": "rgba(230,182,0,1)",
                        "borderColor": "#dddddd",
                        "borderWidth": 1
                    }
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#c12e34"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "rgb(193,46,52)"
                        }
                    }
                }
            },
            "geo": {
                "itemStyle": {
                    "normal": {
                        "areaColor": "#dddddd",
                        "borderColor": "#eeeeee",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "areaColor": "rgba(230,182,0,1)",
                        "borderColor": "#dddddd",
                        "borderWidth": 1
                    }
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#c12e34"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "rgb(193,46,52)"
                        }
                    }
                }
            },
            "categoryAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#b0b0b0"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#f3f3f3"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "rgba(250,250,250,0.3)",
                            "rgba(200,200,200,0.3)"
                        ]
                    }
                }
            },
            "valueAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#b0b0b0"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#f3f3f3"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "rgba(250,250,250,0.3)",
                            "rgba(200,200,200,0.3)"
                        ]
                    }
                }
            },
            "logAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#b0b0b0"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#f3f3f3"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "rgba(250,250,250,0.3)",
                            "rgba(200,200,200,0.3)"
                        ]
                    }
                }
            },
            "timeAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#efefef"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#333"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#b0b0b0"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#f3f3f3"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "rgba(250,250,250,0.3)",
                            "rgba(200,200,200,0.3)"
                        ]
                    }
                }
            },
            "toolbox": {
                "iconStyle": {
                    "normal": {
                        "borderColor": "#06467c"
                    },
                    "emphasis": {
                        "borderColor": "#4187c2"
                    }
                }
            },
            "legend": {
                "textStyle": {
                    "color": "#262626"
                }
            },
            "tooltip": {
                "axisPointer": {
                    "lineStyle": {
                        "color": "#cccccc",
                        "width": 1
                    },
                    "crossStyle": {
                        "color": "#cccccc",
                        "width": 1
                    }
                }
            },
            "timeline": {
                "lineStyle": {
                    "color": "#005eaa",
                    "width": 1
                },
                "itemStyle": {
                    "normal": {
                        "color": "#005eaa",
                        "borderWidth": 1
                    },
                    "emphasis": {
                        "color": "#005eaa"
                    }
                },
                "controlStyle": {
                    "normal": {
                        "color": "#005eaa",
                        "borderColor": "#005eaa",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "color": "#005eaa",
                        "borderColor": "#005eaa",
                        "borderWidth": 0.5
                    }
                },
                "checkpointStyle": {
                    "color": "#005eaa",
                    "borderColor": "rgba(49,107,194,0.5)"
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#005eaa"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "#005eaa"
                        }
                    }
                }
            },
            "visualMap": {
                "color": [
                    "#1790cf",
                    "#a2d4e6"
                ]
            },
            "dataZoom": {
                "backgroundColor": "rgba(47,69,84,0)",
                "dataBackgroundColor": "rgba(47,69,84,0.3)",
                "fillerColor": "rgba(167,183,204,0.4)",
                "handleColor": "#a7b7cc",
                "handleSize": "100%",
                "textStyle": {
                    "color": "#333333"
                }
            },
            "markPoint": {
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#7e7e7e"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "#7e7e7e"
                        }
                    }
                }
            }
        });
    },

    registerDarkTheme(echarts) {
        echarts.registerTheme(Common.default.THEME.DARK, {
            "color": [
                "#ff5252",
                "#3ecbff",
                "#ffc600",
                "#ff5096",
                "#42debf"
            ],
            "backgroundColor": "rgba(0,0,0,0)",
            "textStyle": {},
            "title": {
                "textStyle": {
                    "color": "#ffffff"
                },
                "subtextStyle": {
                    "color": "#ffffff"
                }
            },
            "line": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": "2"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": 2
                    }
                },
                "symbolSize": 4,
                "symbol": "emptyCircle",
                "smooth": true
            },
            "radar": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": "2"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": 2
                    }
                },
                "symbolSize": 4,
                "symbol": "emptyCircle",
                "smooth": true
            },
            "bar": {
                "itemStyle": {
                    "normal": {
                        "barBorderWidth": 0,
                        "barBorderColor": "#ccc"
                    },
                    "emphasis": {
                        "barBorderWidth": 0,
                        "barBorderColor": "#ccc"
                    }
                }
            },
            "pie": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "scatter": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "boxplot": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "parallel": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "sankey": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "funnel": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "gauge": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    },
                    "emphasis": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                }
            },
            "candlestick": {
                "itemStyle": {
                    "normal": {
                        "color": "#fd1050",
                        "color0": "#0cf49b",
                        "borderColor": "#fd1050",
                        "borderColor0": "#0cf49b",
                        "borderWidth": 1
                    }
                }
            },
            "graph": {
                "itemStyle": {
                    "normal": {
                        "borderWidth": 0,
                        "borderColor": "#ccc"
                    }
                },
                "lineStyle": {
                    "normal": {
                        "width": 1,
                        "color": "#aaaaaa"
                    }
                },
                "symbolSize": 4,
                "symbol": "emptyCircle",
                "smooth": true,
                "color": [
                    "#ff5252",
                    "#3ecbff",
                    "#ffc600",
                    "#ff5096",
                    "#42debf"
                ],
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#eeeeee"
                        }
                    }
                }
            },
            "map": {
                "itemStyle": {
                    "normal": {
                        "areaColor": "#eeeeee",
                        "borderColor": "#444444",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "areaColor": "rgba(255,215,0,0.8)",
                        "borderColor": "#444444",
                        "borderWidth": 1
                    }
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#000000"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "rgb(100,0,0)"
                        }
                    }
                }
            },
            "geo": {
                "itemStyle": {
                    "normal": {
                        "areaColor": "#eeeeee",
                        "borderColor": "#444444",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "areaColor": "rgba(255,215,0,0.8)",
                        "borderColor": "#444444",
                        "borderWidth": 1
                    }
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#000000"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "rgb(100,0,0)"
                        }
                    }
                }
            },
            "categoryAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#eeeeee"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#5d4fd6"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "#eeeeee"
                        ]
                    }
                }
            },
            "valueAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#eeeeee"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#5d4fd6"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "#eeeeee"
                        ]
                    }
                }
            },
            "logAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#eeeeee"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#5d4fd6"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "#eeeeee"
                        ]
                    }
                }
            },
            "timeAxis": {
                "axisLine": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisTick": {
                    "show": true,
                    "lineStyle": {
                        "color": "#7668ed"
                    }
                },
                "axisLabel": {
                    "show": true,
                    "textStyle": {
                        "color": "#eeeeee"
                    }
                },
                "splitLine": {
                    "show": true,
                    "lineStyle": {
                        "color": [
                            "#5d4fd6"
                        ]
                    }
                },
                "splitArea": {
                    "show": false,
                    "areaStyle": {
                        "color": [
                            "#eeeeee"
                        ]
                    }
                }
            },
            "toolbox": {
                "iconStyle": {
                    "normal": {
                        "borderColor": "#999999"
                    },
                    "emphasis": {
                        "borderColor": "#666666"
                    }
                }
            },
            "legend": {
                "textStyle": {
                    "color": "#eeeeee"
                }
            },
            "tooltip": {
                "axisPointer": {
                    "lineStyle": {
                        "color": "#c5bdff",
                        "width": "1"
                    },
                    "crossStyle": {
                        "color": "#c5bdff",
                        "width": "1"
                    }
                }
            },
            "timeline": {
                "lineStyle": {
                    "color": "#eeeeee",
                    "width": 1
                },
                "itemStyle": {
                    "normal": {
                        "color": "#dd6b66",
                        "borderWidth": 1
                    },
                    "emphasis": {
                        "color": "#a9334c"
                    }
                },
                "controlStyle": {
                    "normal": {
                        "color": "#eeeeee",
                        "borderColor": "#eeeeee",
                        "borderWidth": 0.5
                    },
                    "emphasis": {
                        "color": "#eeeeee",
                        "borderColor": "#eeeeee",
                        "borderWidth": 0.5
                    }
                },
                "checkpointStyle": {
                    "color": "#e43c59",
                    "borderColor": "rgba(194,53,49,0.5)"
                },
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#eeeeee"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "#eeeeee"
                        }
                    }
                }
            },
            "visualMap": {
                "color": [
                    "#bf444c",
                    "#d88273",
                    "#f6efa6"
                ]
            },
            "dataZoom": {
                "backgroundColor": "rgba(47,69,84,0)",
                "dataBackgroundColor": "rgba(255,255,255,0.3)",
                "fillerColor": "rgba(167,183,204,0.4)",
                "handleColor": "#a7b7cc",
                "handleSize": "100%",
                "textStyle": {
                    "color": "#eeeeee"
                }
            },
            "markPoint": {
                "label": {
                    "normal": {
                        "textStyle": {
                            "color": "#eeeeee"
                        }
                    },
                    "emphasis": {
                        "textStyle": {
                            "color": "#eeeeee"
                        }
                    }
                }
            }
        });
    },
}